﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;

/* Gareth Williams
 * 
 * contains the geometry for a model from the ROM.
 * 
 * based on a bunch of documents by VL-Tone
 * http://homepage.mac.com/qubedstudios/index.html
 * scoured from the internet, mostly using archive.org
 * 
 * right now we store vertices and indices (and ignore BSP trees and faces)
 * aswell as providing a useful interface for vertex and index buffers to consume the data.
 * 
 */

namespace VuzixSample.model.snes.starfox
{
    public class StarFoxGeometry
    {
        public List<Vector3> vertices;
        public List<SFGTriangle> triangles;
        public List<SFGFaceGroup> faces;

        //Todo: in the future we may need to support BSP trees...

        public StarFoxGeometry()
        {
            //backing props
            vertices    = new List<Vector3>();
            triangles   = new List<SFGTriangle>();
            faces       = new List<SFGFaceGroup>();
        }
    }
    #region helper classes
    //helper
    //for verbosity
    public class SFGTriangle
    {
        public uint pointOneIndex;
        public uint pointTwoIndex;
        public uint pointThreeIndex;

        public SFGTriangle(uint pointOneIndex, uint pointTwoIndex, uint pointThreeIndex)
        {
            this.pointOneIndex      = pointOneIndex;
            this.pointTwoIndex      = pointTwoIndex;
            this.pointThreeIndex    = pointThreeIndex;
        }
    }
    public class SFGFaceGroup
    {
        public uint number;
        public uint colour;
        public Vector3 normal;
        public List<uint>vertexIndeces;

        public SFGFaceGroup()
        {
            vertexIndeces = new List<uint>();
        }
    }
    #endregion helper classes
}
